package common_router

import (
	"github.com/gin-gonic/gin"
	v1 "study/server/api/v1"
	"study/server/middleware"
)

func CommonRouter(r *gin.RouterGroup) {
	captchaApi := v1.APP.CaptchaApi
	emailApi := v1.APP.EmailApi
	fileApi := v1.APP.FileApi
	userApi := v1.APP.UserApi
	u := r.Group("")
	{
		u.GET("/generate", captchaApi.GenerateCaptcha)
		u.POST("/email/send", emailApi.SendEmail)
		u.POST("/file/upload", middleware.CheckTokenWhetherBlack(), fileApi.UploadFile)
		u.POST("/login", userApi.Login)
		u.POST("/register", userApi.Register)

	}
}
